JavaScript

A5.u.htmlnotation Method

Syntax

A5.u.html.notation(html,position,settings)

Arguments

htmlstring

The HTML to use as the content for the notation.

positionobjectarray

The position of the content being notated. If an array is used the first value will be used as "left" and the second as "top".

xnumberstring

The horizontal position of the notation. Anchored to the left.

leftnumberstring

The horizontal position of the notation. Anchored to the left.

rightnumberstring

The horizontal position of the notation. Anchored to the right.

ynumberstring

The vertical position of the notation. Anchored to the top.

topnumberstring

The vertical position of the notation. Anchored to the top.

bottomnumberstring

The vertical position of the notation. Anchored to the bottom.

settingsobject

The settings to use when positioning the notation.

tostring

The alignment of the notation relative to the passed in position. Values can be "center" (the default), "above", "below", "before", "after", "adj-above", "adj-below", "adj-before" and "adj-after". Multiple alignments can be applied by combining values using spaces (for example "above after"). The "adj" prefix will make the given alignment occur after the rotation (if any) has been applied.

rotatenumber

The rotation in degrees (-360 to 360) to apply to the notation.

offsetobject

The amount to offset the notation from the given position.

majornumber

The number of pixels to offset the notation on the major axis. The major axis will be the first position (if applicable) in the "to" value.

minornumber

The number of pixels to offset the notation on the minor axis. The major axis will be the second position (if applicable) in the "to" value.

classNamestring

The class name to apply to the outer most container of the notation.

stylestring

The style to apply to the outer most container of the notation.

Returns

htmlstring

The HTML notation.

Description

Create a notation HTML string.

Discussion

This method will take the passed in HTML and wrap it in tags that allow the HTML to be absolutely positioned over content at a given position.

Example

var html = 'Click the "Create" button to start...'
var nHTML = A5.u.html.notation(html,{right: 50, top: 40},{
	to: 'before adj-below',
	rotate: 45,
	offset: {
		major: 10
	}
});
// nHTML = "<div style="position: absolute; right: 50px; top: 40px; "><div style="transform: translate(0px,-50%) rotate(45deg) translate(0px,-50%); transform-origin: right center; padding-right: 10px; text-align: right; ">Click the "Create" button to start...</div></div>"